package com.example.app_down_test;

import android.content.Context;
import android.content.pm.PackageManager;

import androidx.core.content.ContextCompat;

/**
 * @author lubin
 * @version 1.0  2020/12/22.
 * 权限检测工具
 */
public class AlienPermissionTool {
    /**
     * true 缺少所需权限
     */
    public static boolean check(Context context, String[] params) {
        if (params == null) return false;
        for (String p : params) {
            if (ContextCompat.checkSelfPermission(context, p) != PackageManager.PERMISSION_GRANTED) {
                return true;
            }
        }
        return false;
    }
}
